package com.lesserpand.springcloudalibabaprovider.securityoauththree.controller;

import com.lesserpand.springcloudalibabaprovider.securityoauththree.entity.bo.SecurityOauthThreeBO;
import com.lesserpand.springcloudalibabaprovider.securityoauththree.entity.dto.SecurityOauthThreeDTO;
import com.lesserpand.springcloudalibabaprovider.securityoauththree.service.SecurityOauthThreeService;
import com.lesserpand.springcloudalibabaprovider.utils.HttpUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author bailuo
 * @version 2.0
 * @Description TODO
 * @Date Created in 2018/12/10 15:28
 */
@RestController
@RequestMapping("/security-oauth-three")
public class SecurityOauthThreeController {

    private static final Logger LOGGER = LoggerFactory.getLogger(SecurityOauthThreeController.class);

    @Resource
    private SecurityOauthThreeService securityOauthThreeService;

    @PostMapping(value = "", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    public SecurityOauthThreeBO save(SecurityOauthThreeDTO securityOauthThreeDTO) {
        String connectingAddress = HttpUtils.connectingAddress("https://www.baidu.com");
        Boolean isReachable = HttpUtils.isReachable("https://www.baidu.com");
        Boolean isConnServerByHttp = HttpUtils.isConnServerByHttp("https://www.baidu.com");
        LOGGER.info(connectingAddress);
        return new SecurityOauthThreeBO();//securityOauthThreeService.save(securityOauthThreeDTO);
    }
}
